<!doctype html>
<html lang="en">
<head>
    <title>Carousel - Flickr</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="description" content="Overview" />
    <meta name="keywords" content="" />
    <meta name="author" content="ComponentOne" />
    
    <link href="../../themes/rocket/jquery-wijmo.css" rel="stylesheet" type="text/css" />
    
    <link href="../../themes/wijmo/jquery.wijmo-open.2.3.2.css" rel="stylesheet" type="text/css" />
    <link href="../../themes/wijmo/jquery.wijmo.wijtree.css" rel="stylesheet" type="text/css" />
    <script src="../../external/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="../../external/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>
    <script src="../../external/jquery.wijmo-open.all.2.3.2.min.js" type="text/javascript"></script>
    <link href="../../themes/wijmo/jquery.wijmo.wijcarousel.css" rel="stylesheet" type="text/css" />
    <script src="../../wijmo/jquery.wijmo.wijcarousel.js" type="text/javascript"></script>
    <link href="../../themes/wijmo/jquery.wijmo.wijpager.css" rel="stylesheet" type="text/css" />
    <script src="../../wijmo/jquery.wijmo.wijpager.js" type="text/javascript"></script>
    <link href="../../themes/wijmo/jquery.wijmo.wijlightbox.css" rel="stylesheet" type="text/css" />
    <script src="../../wijmo/jquery.wijmo.wijlightbox.js" type="text/javascript"></script>
    <script id="scriptInit" type="text/javascript">
        var count = 15;
        var tags = "Siberian Tiger";

        $(document).ready(function() {        
        
            $("#wijcarousel0").wijcarousel({
                imageSize: {
                    width: 100,
                    height: 150
                },
                display: 3,
                step: 1,
                showTimer: false,
                showPager: false,
                loop: true,              
                loadCallback: function() {
                $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=" + tags + "&tagmode=any&format=json&jsoncallback=?", function(data) {
                    var images = [];
                    $.each(data.items, function(idx, item) {
                        var img = {};
                        img.imageUrl = item.media.m;
                        img.caption = item.title;
                        images.push(img);
                        if (idx == count - 1) return false;
                    });

                    $("#wijcarousel0").wijcarousel("option", "data", images);
                });                
                }
            });

        });
    </script>
    <style type="text/css">
    #wijcarousel0
    {
        width: 700px;
        height: 150px;	
    }
    </style>
</head>
<body class="demo-single">
    <div class="container">
        <div class="header">
            <h2>
                Flickr</h2>
        </div>
        <div class="main demo">
            <!-- Begin demo markup -->
            <div>
                <div id="wijcarousel0">
                </div>
            </div>
            <!-- End demo markup -->
            <div class="demo-options">
                <!-- Begin options markup -->
                <!-- End options markup -->
            </div>
        </div>
        <div class="footer demo-description">
        <p>This sample demonstrates how you can load images from a photo sharing site, like Flickr, into a wijcarousel widget.</p>
        </div>
    </div>
</body>
</html>
